package com.java.jiuyang.cloud.schedule;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Calendar;

/**
 * @ClassName: ScheDuleTime
 * @Description:
 * @Version: v1.0.0
 * @Author: Fu Hao
 * @Date: 2019/11/12 0012 上午 11:13
 * Modification History:
 * Date           Author      Version     Description
 * -------------------------------------------------------------
 * 2019/11/12 0012        Fu Hao      v1.0.0         创建
 */

@RestController
@RequestMapping("/")
public class ScheDuleTime {


    @RequestMapping("/test")
   // @Scheduled(cron = "1/1 * * * * ? ") //定时任务
    public int test(){
        Calendar calendar=Calendar.getInstance();
        int i;
        for (i=0;i<=100;i++){
            System.out.println("定时任务"+i+"---"+calendar.getTime());
        }
        return i;
    }
}
